package com.itkaien.AopAspectjXml;


import com.itkaien.AopAspectjXml.service.UserService;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestDemo {

    @Test
    public void test() {
        ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext("aop/AopX.xml");
        UserService userService = (UserService) classPathXmlApplicationContext.getBean("userService");

        userService.show();
        userService.show1();
    }

    @Test
    public void test1() {
        ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext("aop/AdviceTypeAop.xml");
        UserService userService = (UserService) classPathXmlApplicationContext.getBean("userService");
        userService.show();
    }
}
